package com.ofek.eventos.db.datatypes;

import com.ofek.eventos.util.TimeUtils;

public class SearchScheme implements SearchDefiner {

		
		public String startWith = null;
		public Type type = null;

		public boolean careForTime = false;
		public long from = TimeUtils.inXDays(-1);
		public long to = TimeUtils.inXDays(1);
		public String owner;
		@Override
		public String getStartsWith() {
			return startWith;
		}
		@Override
		public long getStart() {
			if (!careForTime) throw new RuntimeException("why would you ask for start time if you dont care for time?!");
			return from;
		}
		@Override
		public long getEnd() {
			if (!careForTime) throw new RuntimeException("why would you ask for start time if you dont care for time?!");
			return to;
		}
		@Override
		public Long getTypeId() {
			return type.tid;
		}
		@Override
		public boolean careForTime() {
			return careForTime;
		}
		@Override
		public String getOwner() {
			return owner;
		}
}